home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / compress / unz50x16.zip / ZIPINFO.DOC < prev    next >
Text File  |  1992-08-21  |  15KB  |  309 lines

  1. ZIPINFO(1)               USER COMMANDS                 ZIPINFO(1)
  2.  
  3.  
  4.  
  5. NAME
  6.      zipinfo - list detailed information about a ZIP archive file
  7.  
  8. SYNOPSIS
  9.      zipinfo [-1smlvht] file[.zip] [filespec ...]
  10.  
  11. ARGUMENTS
  12.      file[.zip]  Path of the ZIP archive.  The suffix ``.zip'' is
  13.                  applied  if  the  file specified does not exist.
  14.                  Note that self-extracting  ZIP  files  are  sup-
  15.                  ported;  just  specify the ``.exe'' suffix your-
  16.                  self.
  17.  
  18.      [filespec]  An optional list of archive members to  be  pro-
  19.                  cessed.  Expressions may be used to match multi-
  20.                  ple members; be sure to quote  expressions  that
  21.                  contain   characters  interpreted  by  the  Unix
  22.                  shell. See PATTERN  MATCHING  (below)  for  more
  23.                  details.
  24.  
  25. OPTIONS
  26.      -1  list filenames only, one per line (useful for pipes)
  27.      -s  list zipfile  info  in  short  Unix  ``ls  -l''  format:
  28.          default
  29.      -m  list zipfile info in medium Unix ``ls -l'' format
  30.      -l  list zipfile info in long Unix ``ls -l'' format
  31.      -v  list zipfile information in verbose, multi-page format
  32.      -h  list header line
  33.      -t  list totals for files listed or for all files
  34.  
  35. PATTERN MATCHING
  36.      All archive members are listed unless a filespec is provided
  37.      to specify a subset of the archive members.  The filespec is
  38.      similar to an egrep expression, and may contain:
  39.  
  40.      *      matches a sequence of 0 or more characters
  41.      ?      matches exactly 1 character
  42.      \nnn   matches the character having octal code nnn
  43.      [...]  matches any single character found inside the  brack-
  44.             ets; ranges are specified by a beginning character, a
  45.             hyphen, and an ending character.  If  an  exclamation
  46.             point  or  a  carat  (`!'  or  `^')  follows the left
  47.             bracket, then the range of characters matched is com-
  48.             plemented  with  respect  to  the ASCII character set
  49.             (that is, anything except the characters  inside  the
  50.             brackets is considered a match).
  51.  
  52. DESCRIPTION
  53.      ZipInfo lists technical information  about  a  ZIP  archive,
  54.      including  information  file  access permissions, encryption
  55.      status, type of compression, version and operating system of
  56.      compressing program, and the like.  The default option is to
  57.      list files in the following format:
  58.  
  59. -rw-rwl---  1.5 unx    2802 t- defX 11-Aug-91 13:48 perms.2660
  60.  
  61.      The last three fields are clearly the modification date  and
  62.      time of the file, and its name.  The case of the filename is
  63.      respected; thus files  which  come  from  MS-DOS  PKZIP  are
  64.      always  capitalized.   If  the file was zipped with a stored
  65.      directory name, that  is  also  displayed  as  part  of  the
  66.      filename.
  67.  
  68.      The second and third  fields  indicate  that  the  file  was
  69.      zipped  under Unix with version 1.5 of Zip (a beta version).
  70.      Since it comes from Unix, the file permissions at the begin-
  71.      ning   of   the  line  are  printed  in  Unix  format.   The
  72.      uncompressed file-size (2802 in this example) is the  fourth
  73.      field.
  74.  
  75.      The fifth field consists of two characters, either of  which
  76.      may  take  on  several  values.   The first character may be
  77.      either `t' or `b', indicating that Zip believes the file  to
  78.      be  text  or  binary,  respectively;  but  if  the  file  is
  79.      encrypted, ZipInfo notes this fact by capitalizing the char-
  80.      acter  (`T'  or `B').  The second character may also take on
  81.      four values, depending on whether there is an extended local
  82.      header  and/or  an  ``extra field'' associated with the file
  83.      (explained in PKWare's APPNOTE.TXT).  If neither exists, the
  84.      character  will  be  a hyphen (`-'); if there is an extended
  85.      local header but no extra field, `l'; if the  reverse,  `x';
  86.      and  if  both  exist, `X'.  Thus the file in this example is
  87.      (apparently) a text file, is not encrypted, and has  neither
  88.      an  extra field nor an extended local header associated with
  89.      it.  The example below, on the other hand, is  an  encrypted
  90.      binary file with an extra field:
  91.  
  92. RWD,R,R     0.9 vms     168 Bx shrk  9-Aug-91 19:15 perms.0644
  93.  
  94.      Extra fields are used by PKWare for  authenticity  verifica-
  95.      tion(?)  and  possibly other purposes, and by Info-ZIP's Zip
  96.      1.6 and later to store OS/2, Macintosh and VMS  file  attri-
  97.      butes.  This example presumably falls into the latter class,
  98.      then.  Note that the file attributes are listed in VMS  for-
  99.      mat.   Other  possibilities  for  the  host operating system
  100.      include OS/2 with High Performance File System  (HPFS),  DOS
  101.      or  OS/2  with  File Allocation Table (FAT) file system, and
  102.      Macintosh, denoted as follows:
  103.  
  104. arc,,rw,    1.0 os2    5358 Tl i4:3  4-Dec-91 11:33 longfilename.hpfs
  105. arc,hid,rdo,sys dos    4096 b- i4:2 14-Jul-91 12:58 EA DATA. SF
  106. --w-------  1.0 mac   17357 bx i8:2  4-May-92 04:02 unzip.macr
  107.  
  108.      File attributes in the first two cases are  indicated  in  a
  109.      DOS-like  format,  where  the  file  may or may not have its
  110.      archive bit set; may be hidden or not; may be read-write  or
  111.      read-only;  and  may be a system file or not.  If the attri-
  112.      butes are too long,  the  version  number  of  the  encoding
  113.      software is omitted.  (The information is still available in
  114.      the verbose listing, however.)  Interpretation of  Macintosh
  115.      file attributes needs some work yet.
  116.  
  117.      Finally, the sixth field indicates  the  compression  method
  118.      and  possible  sub-method used.  There are six methods known
  119.      at present:  storing (no compression), reducing,  shrinking,
  120.      imploding,  tokenizing,  and  deflating.  In addition, there
  121.      are four levels of reducing (1 through  4);  four  types  of
  122.      imploding  (4K or 8K sliding dictionary, and 2 or 3 Shannon-
  123.      Fano trees); and three levels of  deflating  (fast,  normal,
  124.      maximum  compression).  ZipInfo represents these methods and
  125.      their sub-methods as follows:  ``stor''; ``re:1,'' ``re:2,''
  126.      etc.;  ``shrk'';  ``i4:2,''  ``i8:3,''  etc.;  ``tokn''; and
  127.      ``defF,'' ``defN,'' and ``defX.''
  128.  
  129.      The medium and long listings are  almost  identical  to  the
  130.      short  format except that they add information on the file's
  131.      compression.   The  medium  format  indicates   the   file's
  132.      compression factor as a percentage:
  133.  
  134. -rw-rwl---  1.5 unx    2802 t- 81% defX 11-Aug-91 13:48 perms.2660
  135.  
  136.      In this example, the file has been compressed by more than a
  137.      factor of five; the compressed data are only 19% of the ori-
  138.      ginal size.  The long format  gives  the  compressed  file's
  139.      size in bytes, instead:
  140.  
  141. -rw-rwl---  1.5 unx    2802 t-     538 defX 11-Aug-91 13:48 perms.2660
  142.  
  143.      In addition to individual file information, a  default  zip-
  144.      file listing also includes header and trailer lines:
  145.  
  146. Archive:  OS2.zip   5453 bytes   5 files
  147. ,,rw,       1.0 os2     730 b- i4:3 26-Jun-92 23:40 Contents
  148. ,,rw,       1.0 os2    3710 b- i4:3 26-Jun-92 23:33 makefile.os2
  149. ,,rw,       1.0 os2    8753 b- i8:3 26-Jun-92 15:29 os2unzip.c
  150. ,,rw,       1.0 os2      98 b- stor 21-Aug-91 15:34 unzip.def
  151. ,,rw,       1.0 os2      95 b- stor 21-Aug-91 17:51 zipinfo.def
  152. 5 files, 13386 bytes uncompressed, 4951 bytes compressed:  63%
  153.  
  154.      The header line gives the name of  the  archive,  its  total
  155.      size,  and  the total number of files; the trailer gives the
  156.      number of files listed, their total uncompressed  size,  and
  157.      their  total  compressed  size  (not  including any of Zip's
  158.      internal overhead).  If, however, one or more filespecs  are
  159.      provided, the header and trailer lines are not listed.  This
  160.      behavior is also similar to that of Unix's ``ls -l''; it may
  161.      be  overridden  by  specifying  the -h and -t options expli-
  162.      citly.  In such a case  the  listing  format  must  also  be
  163.      specified  explicitly,  since  -h  or  -t  (or  both) in the
  164.      absence of other options implies that  ONLY  the  header  or
  165.      trailer  line (or both) is listed.  See the EXAMPLES section
  166.      below for a semi-intelligible translation of this nonsense.
  167.  
  168.      The verbose listing is self-explanatory.  It also lists file
  169.      comments  and the zipfile comment, if any, and the number of
  170.      bytes of OS/2 extended attributes  stored.   Note  that  the
  171.      latter  number will in general NOT match the number given by
  172.      OS/2's ``dir'' command; OS/2 always reports  the  number  of
  173.      bytes  required  in  16-bit  format,  whereas ZipInfo always
  174.      reports the 32-bit storage.
  175.  
  176. ENVIRONMENT OPTIONS
  177.      Modifying ZipInfo's default behavior via options  placed  in
  178.      an environment variable can be a bit complicated to explain,
  179.      due to ZipInfo's attempts to handle various defaults  in  an
  180.      intuitive,  yet  Unix-like,  manner.  Nevertheless, there is
  181.      some underlying logic.  In brief, there are three ``priority
  182.      levels''  of  options:   the  default  options;  environment
  183.      options, which can override or  add  to  the  defaults;  and
  184.      explicit  options  given  by the user, which can override or
  185.      add to either of the above.
  186.  
  187.      The default listing  format,  as  noted  above,  corresponds
  188.      roughly  to  the "zipinfo -hst" command (except when indivi-
  189.      dual zipfile members are specified).  A user who prefers the
  190.      long-listing  format  (-l)  can  make  use  of  the  ZIPINFO
  191.      environment variable to change this default:
  192.  
  193.            setenv ZIPINFO -l            Unix C shell
  194.  
  195.            ZIPINFO=-l; export ZIPINFO   Unix Bourne shell
  196.  
  197.            set ZIPINFO=-l               OS/2 or MS-DOS
  198.  
  199.            define ZIPINFO_OPTS "-l"     VMS (quotes for LOWERCASE)
  200.  
  201.      If,  in  addition,  the  user  dislikes  the  trailer  line,
  202.      ZipInfo's concept of ``negative options''  may  be  used  to
  203.      override  the default inclusion of the line.  This is accom-
  204.      plished by preceding the undesired option with one  or  more
  205.      minuses:   e.g., ``-l-t'' or ``--tl'', in this example.  The
  206.      first hyphen is the regular switch character,  but  the  one
  207.      before the `t' is a minus sign.  The dual use of hyphens may
  208.      seem  a  little  awkward,  but  it's  reasonably   intuitive
  209.      nonetheless:   simply  ignore  the  first hyphen and go from
  210.      there.  It is also consistent with the behavior of the  Unix
  211.      command nice(1).
  212.  
  213. EXAMPLES
  214.      To get a basic, short-format listing of  the  complete  con-
  215.      tents of a ZIP archive ``storage.zip,'' with both header and
  216.      totals lines, use only the archive name as  an  argument  to
  217.      zipinfo:
  218.  
  219.            zipinfo storage
  220.  
  221.      To produce  a  basic,  long-format  listing  (not  verbose),
  222.      including header and totals lines, use -l:
  223.  
  224.            zipinfo -l storage
  225.  
  226.      To list the complete contents of the archive without  header
  227.      and  totals  lines,  either  negate the -h and -t options or
  228.      else specify the contents explicitly:
  229.  
  230.            zipinfo --h-t storage
  231.  
  232.            zipinfo storage \*
  233.  
  234.      (where the backslash is required only  if  the  shell  would
  235.      otherwise  expand the `*' wildcard, as in Unix when globbing
  236.      is turned on--double quotes around the asterisk  would  have
  237.      worked  as  well).   To turn off the totals line by default,
  238.      use the environment variable (C shell is assumed here):
  239.  
  240.            setenv ZIPINFO --t
  241.  
  242.            zipinfo storage
  243.  
  244.      To get the full, short-format listing of the  first  example
  245.      again,  given that the environment variable is set as in the
  246.      previous example, it is necessary to specify the  -s  option
  247.      explicitly,  since the -t option by itself implies that ONLY
  248.      the footer line is to be printed:
  249.  
  250.            setenv ZIPINFO --t
  251.  
  252.            zipinfo -t storage           [only totals line]
  253.  
  254.            zipinfo -st storage          [full listing]
  255.  
  256.      The -s option, like -m and -l, includes headers and  footers
  257.      by  default, unless otherwise specified.  Since the environ-
  258.      ment variable specified no footers and  that  has  a  higher
  259.      precedence  than  the default behavior of -s, an explicit -t
  260.      option was necessary to produce the full  listing.   Nothing
  261.      was  indicated  about  the header, however, so the -s option
  262.      was sufficient.  Note that both the -h and -t options,  when
  263.      used  by themselves or with each other, override any default
  264.      listing of member files; only the header and/or  footer  are
  265.      printed.   This  behavior  will  be more useful when ZipInfo
  266.      accepts wildcards for the zipfile name; one may then summar-
  267.      ize the contents of all zipfiles with a single command.
  268.  
  269.      To list information on a single file within the archive,  in
  270.      medium format, specify the filename explicitly:
  271.  
  272.            zipinfo -m storage unshrink.c
  273.  
  274.      The specification of any member file, as  in  this  example,
  275.      will  override the default header and totals lines; only the
  276.      single line of information about the requested file will  be
  277.      printed.   This  is  intuitively  what one would expect when
  278.      requesting information about a single  file.   For  multiple
  279.      files,  it  is often useful to know the total compressed and
  280.      uncompressed size; in such cases -t may be specified  expli-
  281.      citly:
  282.  
  283.            zipinfo -mt storage "*.[ch] Mak\*
  284.  
  285.      Finally, to get maximal information about the  ZIP  archive,
  286.      use the verbose option.  It is usually wise to pipe the out-
  287.      put into a filter such as more(1):
  288.  
  289.            zipinfo -v storage | more
  290.  
  291. TIPS
  292.      The author finds it convenient to set up an alias ``ii'' for
  293.      ZipInfo  on systems which allow aliases, or else to set up a
  294.      batch  file  ``ii.bat''  or  to  rename  the  executable  to
  295.      ``ii.exe'' on systems such as MS-DOS which have no provision
  296.      for aliases.  The ``ii'' usage parallels the  common  ``ll''
  297.      alias  for long listings in Unix, and the similarity between
  298.      the outputs of the two commands was intentional.
  299.  
  300. SEE ALSO
  301.      funzip(1),  unzip(1),   zip(1),   zipcloak(1),   zipnote(1),
  302.      zipsplit(1)
  303.  
  304. AUTHOR
  305.      Greg Roelofs (also known as Cave Newt).  ZipInfo  is  partly
  306.      based  on  S. H. Smith's unzip and contains pattern-matching
  307.      code by  J.  Kercheval,  but  mostly  it  was  written  from
  308.      scratch.  The OS/2 extra-field code is by Kai Uwe Rommel.
  309.